package com.aash.web.mvc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.aash.persistence.exception.DaoException;
import com.aash.service.UserService;
import com.aash.service.model.User;

@Controller
public class HelloWorldController {

	@Autowired
	private UserService userService;
	
    @RequestMapping("/user/{email}")
    @ResponseBody
    public Object helloWorld(@PathVariable String email) throws DaoException {
        User user = null;
        user = userService.getUserByEmail(email);
    	return user;
    }
}
